namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class 继承2 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.JiXiaoSons",
                c => new
                    {
                        jxsid = c.Int(nullable: false, identity: true),
                        jxssx = c.Int(nullable: false),
                        jxsnr = c.String(),
                        jxfz = c.Decimal(nullable: false, precision: 18, scale: 2),
                        jxshtml = c.String(),
                        JiXiao_mbid = c.Int(),
                    })
                .PrimaryKey(t => t.jxsid)
                .ForeignKey("dbo.JiXiaos", t => t.JiXiao_mbid)
                .Index(t => t.JiXiao_mbid);
            
            CreateTable(
                "dbo.JiXiaos",
                c => new
                    {
                        mbid = c.Int(nullable: false),
                        jxsx = c.Int(nullable: false),
                        jxnr = c.String(),
                        jxfz = c.Decimal(nullable: false, precision: 18, scale: 2),
                        jxhtml = c.String(),
                        jxtype = c.Int(nullable: false),
                        cjrid = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.mbid)
                .ForeignKey("dbo.MoBans", t => t.mbid)
                .Index(t => t.mbid);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.JiXiaos", "mbid", "dbo.MoBans");
            DropForeignKey("dbo.JiXiaoSons", "JiXiao_mbid", "dbo.JiXiaos");
            DropIndex("dbo.JiXiaos", new[] { "mbid" });
            DropIndex("dbo.JiXiaoSons", new[] { "JiXiao_mbid" });
            DropTable("dbo.JiXiaos");
            DropTable("dbo.JiXiaoSons");
        }
    }
}
